<?php
/**
 *+------------------
 * Lflow
 *+------------------
 * Copyright (c) 2023~2030 gitee.com/liu_guan_qing All rights reserved.本版权不可删除，侵权必究
 *+------------------
 * Author: Mr.April(405784684@qq.com)
 *+------------------
 */
declare (strict_types=1);

namespace lflow;

use lflow\access\Page;
use lflow\access\QueryFilter;
use lflow\entity\Surrogate;

/**
 * 管理服务接口 用于流程控制服务
 * 委托管理
 * 时间控制
 * @author Mr.April
 * @since  1.0
 */
interface IManagerService
{
    /**
     * saveOrUpdate  保存或更新委托代理对象
     *
     * @param \lflow\entity\Surrogate $surrogate
     */
    public function saveOrUpdate(Surrogate $surrogate): void;

    /**
     * deleteSurrogate  删除委托代理对象
     *
     * @param string $id 委托代理主键id
     */
    public function deleteSurrogate(string $id): void;

    public function getSurrogate(string $id): ?Surrogate;

    public function getSurrogates(string $operator, string $processName = ''): array;

    /**
     * getSurrogate  根据过滤条件查询委托代理对象
     *
     * @param \lflow\access\QueryFilter $filter
     * @param \lflow\access\Page|null   $page
     *
     * @return array
     */
    public function getSurrogateList(QueryFilter $filter, ?Page $page = null): array;

}